﻿//载入系统时候载入
$MET.Load.Install(function () {
    $.messager.confirm('注销账户', '确定注销当前登录账户?', function (r) {
        if (r) {
            //获取数值
            var UserName = $MCC.GetValue("UserName");
            var ChekKey = $MCC.GetValue("ChekKey");

            var RTUrl = "../../../Service/Basic/User/Exit.ashx";
            var RTData = "UserName=" + UserName + "&ChekKey=" + ChekKey;
            //发送请求
            $MRT.Ajax(true, RTUrl, RTData, function (data) {
                var Json = $MJO.GetObject(data);
                //判断是否处理成功
                if (Json != null && Json.Successful == true) {
                    //清空信息
                    $MCC.Clear();
                    //跳转到主界面
                    $MRT.Redirect("Login.html");
                }
                else {
                    alert('用户凭证无效!');
                    $MRT.Redirect("Login.html");
                }
            });
        }
        else {
            //回退
            window.history.go(-1);
        }
    });
});